<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
    <title>中国用户校验</title>
    <link rel="stylesheet" href="../../css/reset.css" />
    <style>
        body {
            width: 100%;
            background-color: #fff;
            font-size: 0.26rem;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            font-family: Helvetica;
            color: #333333;
            height: auto;
        }

        .checkmessage {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            padding-left: 0.24rem;
            box-sizing: border-box;
            border-top: 0.2rem solid #f7f7f7;
        }

        .checkmessage div {
            width: 100%;
            border-bottom: 1px solid #e5e5e5;
            box-sizing: border-box;
            padding-bottom: 0.1rem;
        }

        .checkmessage input {
            outline: none;
            border: none;
            display: inline-block;
            width: 100%;
            height: 0.92rem;
            box-sizing: border-box;
            font-size: 0.26rem;
        }

        .nextbutton {
            width: 6.88rem;
            height: 0.9rem;
            text-align: center;
            line-height: 0.9rem;
            background-color: #ffd203;
            outline: none;
            border: none;
            border-radius: 0.1rem;
            margin-top: 0.8rem;
            margin-left: calc((100% - 6.88rem) / 2);
            font-size: 0.28rem;
        }
    </style>
</head>

<body>
    <div class="checkmessage">
        <div>
            <input type="text" name="" id="userName" placeholder="请输入你的真实姓名;认证后,不能修改" maxlength="30" />
        </div>
        <div>
            <input type="text" name="" id="userNumber" placeholder="请输入你的身份证号;认证后,不能修改" maxlength="30" />
        </div>
    </div>
    <button class="nextbutton">校验</button>

    <script src="../../script/autosize.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/jquery_three_two_one.js"></script>
    <script src="../../script/app.js"></script>
    <script>
        apiready = function () {
            var app = new APP();
            var account = app.getAccount();
            var goAddMoney;
            if (api.pageParam.goAddMoney != undefined && api.pageParam.goAddMoney) {
                goAddMoney = api.pageParam.goAddMoney;
            }
            app.getUserVerify(function (ret) {
                if (ret.code == 200 && ret.data) {
                    $("#userName").val(ret.data.name);
                    $("#userNumber").val(ret.data.id_num);
                }
            })
            $(".nextbutton").on("click", function () {
                if (!$("#userName").val()) {
                    app.toast("姓名不能为空");
                    return;
                }
                if (!$("#userNumber").val()) {
                    app.toast("身份证号不能为空");
                    return;
                }
                app.ajax({
                    param: {
                        method: "post",
                        url: app.ajaxUrl + "member/get-realname-verify",
                        data: {
                            values: {
                                token: account.token,
                                name: $("#userName").val(),
                                id_card: $("#userNumber").val()
                            }
                        },
                        callback: function (ret, err) {
                            if (ret.code == 200) {
                                app.toast('提交成功');
                                app.trigger('add_relnameSuccess');
                                var pageValue = {
                                    name: "littlemoneyrecharge",
                                    subpage: "extrapage/littlemoneyrecharge",
                                    title: "充值",
                                    param: {
                                        pageName: "littlemoneyrecharge",
                                        checkGoMyPage: "true"
                                    },
                                    allowEdit: true
                                }
                                app.setNavBarAttr(pageValue);
                            } else {
                                app.toast(ret.message);
                            }
                        }
                    }
                });
            });
            app.headerMap();
            app.listen("goMain", function () {
                app.closeW();
            })
        };
    </script>
</body>

</html>